package org.loong.crypto.core;

import java.security.Provider;

import org.bouncycastle.jce.provider.BouncyCastleProvider;

/**
 * Global singleton {@link org.bouncycastle.jce.provider.BouncyCastleProvider}.
 */
public enum GlobalBouncyCastleProvider {

    INSTANCE;

    private Provider provider;

    GlobalBouncyCastleProvider() {
        try {
            this.provider = new BouncyCastleProvider();
        } catch (NoClassDefFoundError e) {
            // ignore
        }
    }

    /**
     * Get provider.
     *
     * @return {@link Provider}
     */
    public Provider getProvider() {
        return this.provider;
    }
}
